package com.dongjiantong.openplatform.entity;


import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import java.io.Serializable;

/**
 * @author cao
 * @create 2017-12-13 下午7:05
 **/

@JsonInclude(Include.NON_NULL)
public class OPRequest<T> implements Serializable {
    private static final long serialVersionUID = 8008303917991299807L;
    private T params;

    public static <T> OPRequest<T> ok(T params) {
        OPRequest<T> req = new OPRequest();
        req.setParams(params);
        return req;
    }

    public OPRequest() {
    }

    public T getParams() {
        return this.params;
    }

    public void setParams(T params) {
        this.params = params;
    }

    @Override
    public boolean equals(Object o) {
        if(o == this) {
            return true;
        } else if(!(o instanceof OPRequest)) {
            return false;
        } else {
            OPRequest<?> other = (OPRequest)o;
            if(!other.canEqual(this)) {
                return false;
            } else {
                Object this$params = this.getParams();
                Object other$params = other.getParams();
                if(this$params == null) {
                    if(other$params != null) {
                        return false;
                    }
                } else if(!this$params.equals(other$params)) {
                    return false;
                }

                return true;
            }
        }
    }

    public boolean canEqual(Object other) {
        return other instanceof OPRequest;
    }

    @Override
    public int hashCode() {
        //int PRIME = true;
        int result = 1;
        Object $params = this.getParams();
         result = result * 31 + ($params == null?0:$params.hashCode());
        return result;
    }

    @Override
    public String toString() {
        return "OPRequest(params=" + this.getParams() + ")";
    }
}
